<template>
  <div id="app">
    <headers></headers>
    <menus></menus>
    <nav-list/>
    <router-view v-if="RouterState"/>
    <footers></footers>
    <div class="positions">
      <div class="left" v-if="false &&show" @mouseenter="mouseenter" @mouseleave="mouseleave">
        <img src="../static/img/erweima.jpg" alt/>
        <div>扫码下载app</div>
      </div>
      <div class="right">
        <div @click="handleScrollTop" style="background-color: #fff">
          <img src="../static/img/top_d.png">
          <p style="color:rgba(51,51,51,1);">顶部</p>
        </div>
        <div @mouseenter="mouseenter" @mouseleave="mouseleave"  v-if="false">
          <img src="../static/img/xiazai_s.png">
          <p>
            下载
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import menus from "@/components/menu";
  import headers from "@/components/header";
  import footers from "@/components/footer";
  import NavList from "./components/navList/navList";

  export default {
    provide() {
      return {
        reload: this.reload,
      };
    },
    data() {
      return {
        RouterState: true,
        show: false
      };
    },
    methods: {
      reload() {
        this.RouterState = false;
        this.$nextTick(() => {
          this.RouterState = true;
        });
      },
      handleScrollTop() {
        window.scrollTo(0, 0)
      },
      mouseenter() {
        this.show = true
      },
      mouseleave() {
        clearTimeout(this.timer)
        this.timer = setTimeout(() => {
          this.show = false
        }, 2000)
      }
    },
    components: {
      NavList,
      menus,
      headers,
      footers
    },
    created() {
    }
  };
</script>

<style lang="less" scoped>
  #app {
    font-family: Microsoft YaHei, "微软雅黑", "Avenir", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #e41e1d;
    width: 100%;
    min-height: 100%;
    font-size: 14px;
    background-color: #fff;
  }

  .positions {
    position: fixed;
    right: 0;
    top: 40%;
    z-index: 10;
    display: flex;
    align-items: center;
    width: 192px;
    height: 165px;

    .left {
      background: #E41E1D;
      text-align: center;
      color: #fff;
      cursor: pointer;
      width: 146px;
      height: 165px;
      background: rgba(228, 30, 29, 1);
      border-radius: 5px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      line-height: 12px;
      font-size: 14px;

      img {
        margin-bottom: 10px;
        width: 122px;
        height: 122px;
      }
    }

    .right {
      width: 46px;
      flex: 0 0 46px;
      box-shadow: 0px 3px 7px 0px rgba(156, 156, 156, 0.35);
      position: absolute;
      right: 0;

      > div {
        cursor: pointer;
        width: 46px;
        height: 41px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-direction: column;

        &:last-child {
          background: rgba(51, 51, 51, 1);
          color: #fff;
        }

        p {
          line-height: 11px;
          font-size: 12px;
          margin-top: 3px;
        }
      }
    }
  }

  @media all and (-moz-min-device-pixel-ratio: 1.09) and (-moz-max-device-pixel-ratio: 1.18),
  (-webkit-min-device-pixel-ratio: 1.09) and (-webkit-max-device-pixel-ratio: 1.18),
  (min-resolution: 1.09dppx) and (max-resolution: 1.18dppx) {
    :root {
      font-size: 14px;
    }
  }

  @media all and (-moz-min-device-pixel-ratio: 1.19) and (-moz-max-device-pixel-ratio: 1.28),
  (-webkit-min-device-pixel-ratio: 1.19) and (-webkit-max-device-pixel-ratio: 1.28),
  (min-resolution: 1.19dppx) and (max-resolution: 1.28dppx) {
    :root {
      font-size: 13px;
    }
  }

  @media all and (-moz-min-device-pixel-ratio: 1.29) and (-moz-max-device-pixel-ratio: 1.4),
  (-webkit-min-device-pixel-ratio: 1.29) and (-webkit-max-device-pixel-ratio: 1.4),
  (min-resolution: 1.29dppx) and (max-resolution: 1.4dppx) {
    :root {
      font-size: 12px;
    }
  }

  @media all and (-moz-min-device-pixel-ratio: 1.41) and (-moz-max-device-pixel-ratio: 1.6),
  (-webkit-min-device-pixel-ratio: 1.41) and (-webkit-max-device-pixel-ratio: 1.6),
  (min-resolution: 1.41dppx) and (max-resolution: 1.6dppx) {
    :root {
      font-size: 10px;
    }
  }

  @media all and (-moz-min-device-pixel-ratio: 1.61) and (-moz-max-device-pixel-ratio: 1.8),
  (-webkit-min-device-pixel-ratio: 1.61) and (-webkit-max-device-pixel-ratio: 1.8),
  (min-resolution: 1.61dppx) and (max-resolution: 1.8dppx) {
    :root {
      font-size: 9px;
    }
  }

  @media all and (-moz-min-device-pixel-ratio: 1.81) and (-moz-max-device-pixel-ratio: 2.1),
  (-webkit-min-device-pixel-ratio: 1.81) and (-webkit-max-device-pixel-ratio: 2.1),
  (min-resolution: 1.81dppx) and (max-resolution: 2.1dppx) {
    :root {
      font-size: 8px;
    }
  }

  @media screen and (max-width: 1200px) {
    #app {
      width: 1280px;
      overflow: auto;
    }
  }
</style>
